﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace TestEngine
{
    class Collider
    {
        Matrix mRot;
        Vector2 tempVec;
        Vector2 cPos;
        Vector2 cSize;

        public Collider(Vector2 pos, Vector2 size)
        {
            mRot = Matrix.CreateRotationZ(3);
            tempVec = new Vector2(10, 10);
            tempVec = Vector2.Transform(tempVec, mRot);
            cPos = pos;
            cSize = size;
        }

        public void setCustomCollisionRect(Vector2 size)
        {
            cSize = size;
        }

        public void update(int d_time, Actor _actor)
        {
            cPos = _actor.position;
        }

        public Vector2[] getRect_byVect()
        {
            Vector2[] returnCoords = new Vector2[2];
            returnCoords[0].X = cPos.X;
            returnCoords[0].Y = cPos.Y;
            returnCoords[1].X = cSize.X;
            returnCoords[1].Y = cSize.Y;
            return returnCoords;
        }

        public Rectangle getRect()
        {
            Rectangle returnCoords = new Rectangle((int)cPos.X, (int)cPos.Y, (int)cSize.X, (int)cSize.Y);
            return returnCoords;
        }
    }
}
